﻿using System.Collections.Generic;
using System.Linq;
using Missbot.Common;

namespace Missbot.AIModule.Pet.Cooking
{
    public class CookingLevelSvc : IDataMgr, ISingleton
    {
        private List<CookingLevel> CookingLevels;

        public CookingLevel this[int level] => CookingLevels.FirstOrDefault(p => p.Level == level);

        public CookingLevel LocationLevel(int totalPrice)
        {
            return CookingLevels.LastOrDefault(p => p.NeedPrice <= totalPrice);
        }

        public void RefreshData()
        {
            CookingLevels = CookingLevelDA.GetAll();
        }
    }
}